Confidence interval for the percentage of variance retained by the first \(\kappa\) components.
eigci(x, k, alpha = 0.05, B = 1000, graph = TRUE)A list including:
If B=1 (no bootstrap) a vector with the esimated percentage of variance due to the first \(k\) components, \(\hat{\psi}\) and its associated asymptotic \((1-\alpha)\%\) confidence interval. If B>1 (bootstrap) a vector with: the esimated percentage of variance due to the first \(k\) components, \(\hat{\psi}\), its bootstrap estimate and its bootstrap estimated bias.
This appears if B>1 (bootstrap). The standard bootstrap and the empirical bootstrap \((1-\alpha)\%\) confidence interval for \(\psi\).
Futher, if B>1 and "graph" was set equal to TRUE, a histogram with the bootstrap \(\hat{\psi}\) values, the observed \(\hat{\psi}\) value and its bootstrap estimate.
A numerical matrix with more rows than columns.
The number of principal components to use.
This is the significance level. Based on this, an \((1-\alpha)\%\) confidence interval will be computed.
The number of bootstrap samples to generate.
Should the plot of the bootstrap replicates appear? Default value is TRUE.
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
The algorithm is taken by Mardia Kent and Bibby (1979, pg. 233--234). The percentage retained by the fist \(\kappa\) principal components denoted by \(\hat{\psi}\) is equal to $$ \hat{\psi}=\frac{ \sum_{i=1}^{\kappa}\hat{\lambda}_i }{\sum_{j=1}^p\hat{\lambda}_j }, $$ where \(\hat{\psi}\) is asymptotically normal with mean \(\psi\) and variance $$ \tau^2 = \frac{2}{\left(n-1\right)\left(tr\pmb{\Sigma} \right)^2}\left[ \left(1-\psi\right)^2\left(\lambda_1^2+...+\lambda_k^2\right)+ \psi^2\left(\lambda_{\kappa+1}^2+...\lambda_p^2\right) \right], $$ where \(a=\left( \lambda_1^2+...+\lambda_k^2\right)/\left( \lambda_1^2+...+\lambda_p^2\right)\) and \(\text{tr}\pmb{\Sigma}^2=\lambda_1^2+...+\lambda_p^2\).
The bootstrap version provides an estimate of the bias, defined as \(\hat{\psi}_{boot}-\hat{\psi}\) and confidence intervals calculated via the percentile method and via the standard (or normal) method Efron and Tibshirani (1993). The funciton gives the option to perform bootstrap.
Mardia K.V., Kent, J.T. and Bibby, J.M. (1979). Multivariate Analysis. London: Academic Press.
Efron B. and Tibshirani R. J. (1993). An introduction to the bootstrap. Chapman & Hall/CRC.
pc.choose
x <- as.matrix(iris[, 1:4])
eigci(x, k = 2, B = 1)
Run the code above in your browser using DataLab